package com.qf.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/7/6 14:07
 */
@RestController
public class SearchController {

    @RequestMapping("/search")
    @HystrixCommand(fallbackMethod = "testFindBack")
    public String test(){
          int i=1/0;
        System.out.println("这是第一个");
        return  "这个Search微服务被调用到了!";
    }


    public  String testFindBack(){
        System.out.println("降级方法");
        return  "调用到了降级方法";
    }


     @RequestMapping("/api/search")
       public String apitest(){
         System.out.println("这是第二个");
        return  "这个Search微服务被调用到了!";

    }
}
